dojo.provide("miaigo.model.MoveTree");

dojo.declare(
    "miaigo.model.MoveTree",
    null,
    {
	// the owner move
	// If owner is not null, this tree is an alternation.
	_owner: null,

	// Array of moves
	_moves: null,

	// createParam:
	// {
	//   owner: miaigo.model.Move
	// }
	constructor: function(createParam)
	{
	    if (createParam)
	    {
		this._owner = createParam.owner;
	    }

	    this._moves = [];
	},

	getOwner: function()
	{
	    return this._owner;
	},

	addMove: function(/* miaigo.model.Move */move)
	{
	    move.setParent(this);
	    this._moves.push(move);
	},

	getMoveCount: function()
	{
	    return this._moves.length;
	},

	getMove: function(/* Number */index)
	{
	    return this._moves[index];
	}
    });